# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Eric Bélanger <eric@archlinux.org>

pkgname=mpg123
pkgver=1.31.3
pkgrel=1
pkgdesc='Console based real time MPEG Audio Player for Layer 1, 2 and 3'
url="https://sourceforge.net/projects/mpg123"
arch=('x86_64')
license=('LGPL2.1')
depends=('alsa-lib')
makedepends=('sdl2' 'jack' 'libpulse')
optdepends=('sdl2: for sdl audio support'
            'jack: for jack audio support'
            'libpulse: for pulse audio support'
            'perl: for conplay')
provides=(libmpg123.so libout123.so)
source=(https://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tar.bz2{,.sig})
sha512sums=('5dd550e06f5d0d432cac1b7e546215e56378b44588c1a98031498473211e08bc4228de45be41f7ba764f7f6c0eb752a6501235bcc3712c9a8d8852ae3c607d98'
            'SKIP')
validpgpkeys=('D021FF8ECF4BE09719D61A27231C4CBC60D5CAFE')

build() {
  cd ${pkgname}-${pkgver}
  ./configure \
    --prefix=/usr \
    --enable-int-quality \
    --with-audio="alsa oss sdl jack pulse"
  # https://bugzilla.gnome.org/show_bug.cgi?id=655517
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
  install -Dm 755 scripts/conplay "${pkgdir}/usr/bin/conplay"
}

# vim: ts=2 sw=2 et:
